Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 7 - View-Related Objects / View-Related Objects Reference
View Device Functions / Creating and Manipulating View Device Objects


GXNewViewDevice

You can use the GXNewViewDevice function to create a new view device object.

gxViewDevice GXNewViewDevice  (gxViewGroup group, 
                               gxShape bitmapShape);
group
A reference to the view group in which to create the view device.
bitmapShape
A reference to a bitmap shape that defines the view device's imaging area.
function result
A reference to the newly created view device object.
DESCRIPTION
The GXNewViewDevice function creates a new view device object in the specified view group. The bitmapShape parameter references a bitmap shape whose bitmap structure specifies the height, width, and pixel depth (bits per pixel) of the device, plus any color set or color profile used by the device. The remaining properties have default values:

To obtain an offscreen view group reference to pass to this function, use the GXNewViewGroup function. To create a view device in the onscreen view group, pass the value gxScreenViewDevices for the group parameter.

SPECIAL CONSIDERATIONS
The bitmap shape that you pass to this function cannot not have a disk-based pixel image.

If no error occurs, the GXNewViewDevice function creates a view device object; you are responsible for disposing of that object when you no longer need it.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
invalid_viewGroup_reference 
illegal_type_for_shape(debugging version)
SEE ALSO
For examples of the use of this function, see Listing 7-9 on page 7-53 and Listing 7-14 on page 7-63.

To dispose of a view device, use the GXDisposeViewDevice function, described
next. To dispose of all the view devices in a view group, use the GXDisposeViewGroup function, described on page 7-122.

For information about bitmap shapes and the bitmap structure, see the bitmap shapes chapter of Inside Macintosh: QuickDraw GX Graphics.

The GXNewViewGroup function is described on page 7-122. The gxScreenViewDevices view group reference is described in the section
"View Group Types" on page 7-69.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996